import WebVitals from './lib/webvitals'
import UserVitals from './lib/userVitals'
import ErrorVitals from './lib/errorVitals'

let timing =
  // W3C Level2  PerformanceNavigationTiming
  // 使用了High-Resolution Time，时间精度可以达毫秒的小数点好几位。
  performance.getEntriesByType('navigation').length > 0
    ? performance.getEntriesByType('navigation')[0]
    : performance.timing; // W3C Level1  (目前兼容性高，仍然可使用，未来可能被废弃)。
const webvital = new WebVitals(timing);
const userVitals = new UserVitals(timing);
const errorVitals = new ErrorVitals(timing, { Vue: '' });
console.log(webvital.metrics.state);
console.log(userVitals.metrics.state)
